<?php


namespace App\HttpController\Sso;


use App\Exceptions\MissParamsException;
use App\HttpController\Base\LoginBase;
use App\Service\LoginService;
use App\Utility\JwtAuth;

class Login extends LoginBase
{
    public function weappLogin()
    {
        $code = $this->request()->getRequestParam('code');
        if (!$code) {
            throw new MissParamsException('code');
        }
        $raw_data = $this->getRawData();

        $ret = LoginService::weappLogin($code, $this->system_app_id, $raw_data);
        return $this->success('登录成功', $ret);

    }


}